package com.gaofeng.day10;

import java.util.Scanner;

/**
 * @author gaofeng
 * @date 2024-12-22 - 8:50
 */
public class demo04 {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个数字");
        int number = scanner.nextInt();
        System.out.println(number);

        for (int i = 0; i < number; i++) {
            if(i*i == number){
                System.out.println(i + "就是" + number +"的平方根");
                break;
            } else if(i*i > number){
                System.out.println((i-1) + "就是" + number +"的平方根整数部分");
                break;
            }
        }
        


        scanner.close();
    }
}
